package com.yzd.learnjava.arrays;

import java.util.Arrays;

import com.yzd.learnjava.util.Generated;
import com.yzd.learnjava.util.Print;
import com.yzd.learnjava.util.RandomGenerator;

public class AlphabeticSearch {
	public static void main(String[] args) {
		String[] sa = Generated.array(new String[30], new RandomGenerator.String());
		Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
		Print.print(Arrays.toString(sa));
		
		int index = Arrays.binarySearch(sa, sa[10], String.CASE_INSENSITIVE_ORDER);
		Print.print("Index: " + index + "\n" + sa[index]);
	}
}
